package com.rundow;

import com.rundow.common.base.utils.ApplicationContextUtil;
import com.rundow.common.sdk.service.DriverCommandService;
import com.rundow.common.sdk.service.DriverScheduleService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * Created by rundow on 2023/1/17 15:44
 */


@SpringBootApplication
@EnableTransactionManagement
@EnableFeignClients(basePackages = "com.rundow.api.**")
public class IotBootApplication {

    public static void main(String[] args) {
        SpringApplication.run(IotBootApplication.class);
    }







    @Bean
    public DriverScheduleService modbusDriverScheduleService() {
        final DriverScheduleService modbusDriverScheduleService = ApplicationContextUtil.getBean(DriverScheduleService.class);
        return modbusDriverScheduleService;
    }

    @Bean
    public DriverScheduleService opcuaDriverScheduleService() {
        final DriverScheduleService opcuaDriverScheduleService = ApplicationContextUtil.getBean(DriverScheduleService.class);
        return opcuaDriverScheduleService;
    }


    @Bean
    public DriverScheduleService opcdaDriverScheduleService() {
        final DriverScheduleService opcdaDriverScheduleService = ApplicationContextUtil.getBean(DriverScheduleService.class);
        return opcdaDriverScheduleService;
    }
    @Bean
    public DriverScheduleService listeningVirtualDriverScheduleService() {
        final DriverScheduleService listeningVirtualDriverScheduleService = ApplicationContextUtil.getBean(DriverScheduleService.class);
        return listeningVirtualDriverScheduleService;
    }


    @Bean
    public DriverScheduleService plcs7DriverScheduleService() {
        final DriverScheduleService opcuaDriverScheduleService = ApplicationContextUtil.getBean(DriverScheduleService.class);
        return opcuaDriverScheduleService;
    }

    @Bean
    public DriverScheduleService virtualDriverScheduleService() {
        final DriverScheduleService opcuaDriverScheduleService = ApplicationContextUtil.getBean(DriverScheduleService.class);
        return opcuaDriverScheduleService;
    }

    @Bean
    public DriverCommandService modbusDriverCommandService() {
        final DriverCommandService modbusDriverCommandService = ApplicationContextUtil.getBean(DriverCommandService.class);
        return modbusDriverCommandService;
    }

    @Bean
    public DriverCommandService opcuaDriverCommandService() {
        final DriverCommandService opcuaDriverCommandService = ApplicationContextUtil.getBean(DriverCommandService.class);
        return opcuaDriverCommandService;
    }


    @Bean
    public DriverCommandService opcdaDriverCommandService() {
        final DriverCommandService opcdaDriverCommandService = ApplicationContextUtil.getBean(DriverCommandService.class);
        return opcdaDriverCommandService;
    }

    @Bean
    public DriverScheduleService listeningVirtualDriverCommandService() {
        final DriverScheduleService listeningVirtualDriverCommandService = ApplicationContextUtil.getBean(DriverScheduleService.class);
        return listeningVirtualDriverCommandService;
    }


    @Bean
    public DriverCommandService plcs7DriverCommandService() {
        final DriverCommandService plcs7DriverCommandService = ApplicationContextUtil.getBean(DriverCommandService.class);
        return plcs7DriverCommandService;
    }

    @Bean
    public DriverCommandService virtualDriverCommandService() {
        final DriverCommandService virtualDriverCommandService = ApplicationContextUtil.getBean(DriverCommandService.class);
        return virtualDriverCommandService;
    }


}
